//
//  RegisterPage.swift
//  Uber
//
//  Created by chen on 16/3/10.
//  Copyright © 2016年 chen. All rights reserved.
//

import UIKit

class RegisterPage: FxBasePage,SelectCountryDelegate {
    @IBOutlet weak var country:UIButton!
    @IBOutlet weak var emailTextField: UITextField!
    @IBOutlet weak var phoneTextField: UITextField!
    @IBOutlet weak var pwdTextField: UITextField!
    override func viewDidLoad() {
        super.viewDidLoad()
        self.title = "创建账号"
        setNavigationItem("下一步", selector: "goRight", isRight: true)
        setNavigationItem("取消", selector: "goBack", isRight: false)
        country.imageView?.image = UIImage(named: "CN.png")
        backView.layer.masksToBounds = true
        backView.layer.cornerRadius = 5
        

        // Do any additional setup after loading the view.
    }
    override func goRight() {
        let page = UserInfoPage()
        self.navigationController?.pushViewController(page, animated: true)
    }
    @IBAction func doSelectCountry(){
        let page = SelectCountry()
        page.delegate = self
        let navPage = UINavigationController(rootViewController: page)
        self.presentViewController(navPage, animated: true, completion: nil)
    }
    func setCountryCodeAndFlag(code: String, flag: String) {
        self.phoneTextField.text = code
        self.country.imageView?.image = UIImage(named: flag)
        print(code + flag)
    }

}
